/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fix.it.source.fixit;

import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Biserka
 */
@Stateless
public class LogInBean {
@PersistenceContext(unitName="fix.it.source_FixIt_war_1.0-SNAPSHOTPU")
    private EntityManager entityManager;
    @NewUserInterceptor
    public void storeLocalUser(Localuser localUser){
        Logger.getLogger(localUser.toString()).log(Level.INFO, "user created");
      Random rand = new Random();
      localUser.setId(rand.nextLong());
      entityManager.persist(localUser);
    } 
}
